{% extends "base_content.html" %}
{% load extra_tags %}
{% load extra_filters %}
{% load humanize %}
{% block title %}{% spaceless %}{{ book.title }}-读书频道{% endspaceless %}{% endblock %}
{% block forejs %}
       <script type="text/javascript">        
         $().ready(function(){
            $("#nav_books").attr('className',"on");
            //$("#nav_ask").hide();
        });
         
        </script>
{% endblock %}
{% block content %}
    <div class="headNormal"><a href="{{ book.get_absolute_url }}">《{{ book.title }}》</a></div>
    <div class="bookInfo">
        <div class="bookCover">
            <img src="{{ book.cover_img }}" >
        </div>
        <div class="bookSummary">
            <table>
    	        <tr>
    	        	<td>【作者】</td>
    	        	<td><b><a href="{% url user book.user.id %}" rel="nofollow" >{{ book.author }}</a></b></td>
    	        </tr>
    	        <tr>
    	        	<td>【出版社】</td>
    	        	<td>{{ book.publication }}</td>
    	        </tr>
                <tr>
    	        	<td>【出版日期】</td>
    	        	<td>{{ book.published_at|date:"Y-m" }}</td>
    	        </tr>
                <tr>
    	        	<td>【价格】</td>
    	        	<td>{{ book.price }} 元</td>
    	        </tr>
                <tr>
    	        	<td>【页数】</td>
    	        	<td>{{ book.pages }} 页</td>
    	        </tr>
                <tr>
    	        	<td>【标签】</td>
    	        	<td>{{ book.tagnames }}</td>
    	        </tr>
                <tr>
    	        	<td>&nbsp;</td>
    	        	<td> </td>
    	        </tr>
                {% if author_info.blog_url %}
                <tr>
                    <td></td>
                    <td><a href="{{ author_info.blog_url }}" rel="nofollow" >作者博客 »</a></td>
    	        </tr>
                
                {% endif %}
                <tr>
                    <td> </td>
                    <td><a href="#" rel="nofollow">书籍目录 »</a></td>
    	        </tr>
                <tr>
                    <td> </td>
                    <td><a href="#" rel="nofollow">网上购买 »</a></td>
    	        </tr>
            </table>
        </div>
        <div class="blogRss">
    
        </div>
    </div>
    
    <div class="bookQuestions">
        
        <div class="tabBar">
            <div class="tabsB">
                <a id="qa" class="on" title="图书相关的技术答疑" href="#">答读者问</a>
            </div>
        </div>
        <div class="bookAsk"><a href="{% url ask_book book.short_name %}">向作者提问</div>
        <div class="user-stats-table">
            {% for question in questions.object_list %}
                {% if question.favourite_count %}
                    {% if question.favorited_myself %}
                        <div class="favorites-count">
                            <img title="这个问题被 {{question.favourite_count}} 位用户收藏" src="/content/images/vote-favorite-on.png">
                            <div><b>{{question.favourite_count|intcomma}}</b></div>
                        </div>
                    {% else %}
                        <div class="favorites-count-off">
                            <img title="这个问题被 {{question.favourite_count}} 位用户收藏" src="/content/images/vote-favorite-off.png">
                            <div><b>{{question.favourite_count|intcomma}}</b></div>
                        </div>
                    {% endif %}
                {% else %}
                    <div class="favorites-empty"> </div>
                {% endif %}
            <div id="question-summary-{{question.id}}" class="question-summary narrow">
                <a style="text-decoration: none;" href="/questions/{{question.id}}/{{question.get_question_title}}">
                    <div class="stats">
                        <div class="votes">
                            <div class="vote-count-post">{{question.score|intcomma}}</div> 
                            票
                          
                        </div>
                        <div title="{% if question.answer_accepted %}有答案已被接受为正确答案{% endif %}" class="status {% if question.answer_accepted %}answered-accepted{% endif %} {% ifequal question.answer_count 0 %}unanswered{% endifequal %}{% ifnotequal question.answer_count 0 %}answered{% endifnotequal %}">
                            <div class="answer-count-post">{{question.answer_count|intcomma}}</div>
                            回答
                     
                        </div>
                        <div class="views">
                             <div class="views-count-post">{{question.view_count|cnprog_intword|safe}}</div>
                             浏览
                        </div>
                    </div>
                </a>
                <div class="bookQuestionItem">
                    <h3>
                        <a title="{{question.summary}}" href="/questions/{{question.id}}/{{question.title}}">{{question.title}}</a>
                    </h3>
                    <div class="tags">
                        {% for tag in question.tagname_list %}
                        <a href="{% url forum.views.tag tag|urlencode %}" title="查看有关'{{ tag }}'的问题" rel="tag">{{ tag }}</a>
                        {% endfor %}
                    </div>
                    <div class="started">
                        <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>
                        <span class="score">{% get_score_badge question.last_activity_by %} </span>
                        <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
                    </div>
                </div>
            </div>
            <br clear="both"/>
            {% endfor %}
        </div>
    </div>
{% endblock %}
{% block tail %}
                            
                        <div class="pager">
                            {% cnprog_paginator context %}
                            
                        </div>
                        <div class="bookFeed">
                            <div id="feeds">
                                <a href="/feeds/rss" title="RSS订阅该图书最新问题">订阅最新问题</a>
                            </div>
                        </div>

{% endblock %}